home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
BUS
/
TMCM Software and Labs.sit
/
Software for TMCM 7_95
/
Files for Lab 9
/
Other Examples
/
Tiling Example
< prev
Wrap
Text File
|
1994-05-09
|
1KB
|
68 lines
{ This program was written by Professor Kevin Mitchell. It uses
an advanced feature of xTurtle that will not be covered in
CS100: "multitasking." This uses a "fork" command to make
many turtles that can each operate separately. Mitchell uses
this capability to draw an interesting regular pattern that
is an example of a "tiling of the plane." The whole (x,y)-plane
is filled with copies of two figures, an arrow-shaped figure
and a cross-shaped figure.
IMPORTANT! Turn off the "Autoscroll to Show Turtle feature in
the Options Menu before you run this program!!!
This tiling of the plane was designed by the Persian artist
Mirza Akbar early 19th century.}
sub rArrow
penDown
move(1,0)
move(0,.5)
move(1,1)
move(.5,0)
move(0,1)
move(-1,0)
move(0,-.5)
move(-1,-1)
move(-.5,0)
move(0,-1)
end sub
sub lArrow
penDown
move(0,-1)
move(.5,0)
move(1,-1)
move(0,-.5)
move(1,0)
move(0,1)
move(-.5,0)
move(-1,1)
move(0,.5)
move(-1,0)
end sub
sub upArrows
fork(10)
penUp
moveTo(3*(forkNumber-5),0)
fork(10)
move(0,3*(forkNumber-5))
rArrow
end sub
sub downArrows
fork(10)
penUp
moveTo(3*(forkNumber-5)+1.5,1)
fork(10)
move(0,3*(forkNumber-5))
lArrow
end sub
upArrows
downArrows